package main

import "gosum/server/src/game"

func main() {

	game.GetServer().Start()

	return
}

//
//func playerSet(player *game.Player) {
//
//	//加锁
//	startTime1 := time.Now().Nanosecond()
//	for i := 0; i < 1000000; i++ {
//		player.ModUniqueTask.Locker.Lock()
//		player.ModUniqueTask.MYTaskInfo[10001] = new(game.TaskInfo)
//		player.ModUniqueTask.Locker.Unlock()
//	}
//	endtime1 := time.Now().Nanosecond() - startTime1
//	fmt.Println(endtime1 / 1000000)
//
//	//不加锁
//	startTime2 := time.Now().Nanosecond()
//	for i := 0; i < 1000000; i++ {
//		//player.ModUniqueTask.Locker.Lock()
//		player.ModUniqueTask.MYTaskInfo[10001] = new(game.TaskInfo)
//		//player.ModUniqueTask.Locker.Unlock()
//	}
//	endtime2 := time.Now().Nanosecond() - startTime2
//	fmt.Println(endtime2 / 1000000)
//
//	startTime3 := time.Now().Nanosecond()
//	for i := 0; i < 1000000; i++ {
//		//player.ModUniqueTask.Locker.RLock()
//		_, ok := player.ModUniqueTask.MYTaskInfo[10001]
//		if ok {
//
//		}
//		//player.ModUniqueTask.Locker.RUnlock()
//	}
//	endTime3 := time.Now().Nanosecond() - startTime3
//	fmt.Println(endTime3 / 1000000)
//
//}
//
//func playerGet(player *game.Player) {
//	//加锁
//	startTime4 := time.Now().Nanosecond()
//	for i := 0; i < 1000000; i++ {
//		player.ModUniqueTask.Locker.RLock()
//		_, ok := player.ModUniqueTask.MYTaskInfo[10001]
//		if ok {
//
//		}
//		player.ModUniqueTask.Locker.RUnlock()
//	}
//	endTime4 := time.Now().Nanosecond() - startTime4
//	fmt.Println(endTime4 / 1000000)
//
//}
//map在只读的情况下 不需要加锁
//func playerLoadConfig(player *game.Player) {
//	for i := 0; i < 1000000; i++ {
//		config := csv.ConfigUniqueTaskMap[10001]
//		if config != nil {
//			println(config.TaskId)
//		}
//	}
//}
//player.ModBag.AddItemToBag(1000003, 1000)
//player.ModBag.RemoveItemToBag(1000003, 1100)
//player.ModBag.AddItemToBag(1000003, 1000)
//player.ModPlayer.SetCard(4000012, player)
//player.ModBag.AddItem(4000012, player)
//player.ModBag.AddItem(4000012, player)
//player.ModPlayer.SetCard(4000012, player)
//player.ModPlayer.SetIcon(3000012, player)
//player.ModBag.AddItem(3000012, player)
//player.ModBag.AddItem(3000012, player)
//player.ModPlayer.SetIcon(3000012, player)
//player.ModBag.AddItem(1000003, player)
//player.ModBag.AddItem(1000006, player)
//player.ModBag.AddItem(1000009, player)
//player.ModBag.AddItem(2000001, player)
//player.ModBag.AddItem(2000017, player)
//player.ModBag.AddItem(2000088, player)
//player.ModBag.AddItem(3000012, player)
//player.ModBag.AddItem(3000088, player)
//player.ModBag.AddItem(4000014, player)
//player.ModPlayer.SetShowTeam([]int{1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009, 1010}, player)
//player.ModPlayer.SetShowCard([]int{1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009, 1010}, player)
//player.ModPlayer.SetShowCard([]int{}, player)
//player.ModPlayer.SetShowCard([]int{1001}, player)
//player.ModPlayer.SetBirth(1301, player)
//player.ModPlayer.SetBirth(230, player)
//player.ModPlayer.SetBirth(10, player)
//player.ModPlayer.SetBirth(530, player)
//player.ModPlayer.SetBirth(904, player)
//player.ModPlayer.AddExp(10000000, player)
//go playerLoadConfig(player
//ticket := time.NewTicker(time.Second * 10)
//for {
//	select {
//	//监听接口
//	case <-ticket.C:
//		playerTest := game.NewTestPlayer()
//		go playerTest.Run()
//	}
//}
//监听客户端
//for {
//
//}
//
//player.RecvSetIcon(1)
//player.RecvSetIcon(2)
//player.RecvSetIcon(3)
//
//player.RecvSetCard(1)
//player.RecvSetCard(3)
//player.RecvSetCard(5)
//
//player.RecvSetName("s1s2")
//player.RecvSetName("求外挂")
//player.RecvSetName("原神？")
//player.RecvSetName("wo yan")
